<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>试卷详情</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/resource/resourcePaper/">试卷管理列表</a></li>
		<li class="active"><a href="${ctx}/resource/resourcePaper/detail?id=${resourcePaper.id}">试卷详情</a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="resourcePaper" action="" method="post" class="form-horizontal">
		<%--<form:hidden path="id"/>--%>
		<sys:message content="${message}"/>
		<input type="hidden" name="type" id="type" value="${type}">

		<div class="control-group">
			<label class="control-label">试卷名称：</label>
			<div class="controls">
				<form:input path="paperName" htmlEscape="false" maxlength="64" class="input-xlarge required" readonly="true"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">试卷属性：</label>
			<div class="controls">
				<form:select path="paperAttribute" class="input-xlarge required" disabled="true">
					<form:option value="" label=""/>
					<form:options items="${fns:getDictList('resource_paper_attribute')}" itemLabel="label" itemValue="value" htmlEscape="false"/>
				</form:select>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">试卷类别：</label>
			<div class="controls">
				<form:radiobuttons path="paperType" items="${fns:getDictList('resource_paper_type')}" itemLabel="label" itemValue="value" htmlEscape="false" class="required" disabled="true"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		</div>
		<div class="control-group">
			<label class="control-label">题目：</label>
			<div class="controls">
				<table id="contentTable" class="table table-striped table-bordered table-condensed">
					<thead>
					<tr>
						<th>题目序号</th>
						<th>题目名称</th>
						<th>题目类型</th>
					</tr>
					</thead>
					<tbody>
					<c:forEach items="${page.list}" var="resourceQuestion" varStatus="status">
						<tr>
							<td>
									${status.count}
							</td>
							<td>
									${resourceQuestion.questionName}
							</td>
							<td>
									${fns:getDictLabel(resourceQuestion.questionType,'resource_question_type',"无")}
							</td>
						</tr>
					</c:forEach>
					</tbody>
				</table>
				<div class="pagination">${page}</div>
			</div>
		</div>
		<div class="form-actions">
			<%--<shiro:hasPermission name="resource:resourcePaper:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>--%>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
	<script>
		var demo1 = $('select[class="resetDuallist"]').bootstrapDualListbox();
		$("#demoform").submit(function() {
			alert($('[class="resetDuallist"]').val());
			return false;
		});
	</script>
</body>
</html>